Developer --> Technical Publications
PATHHardware Documentation > USB Devices > Mac OS USB DDK API Reference


USBFindNextEndpointDescriptorImmediate

The USBFindNextEndpointDescriptorImmediate function returns the address to the next endpoint descriptor in a configuration descriptor that follows a specified interface descriptor. This is a synchronous call.

OSStatus USBFindNextEndpointDescriptorImmediate(USBPB *pb)

Required fields in the USBPB parameter block for the USBFindNextEndpointDescriptorImmediate function are

--> pbLength
Length of parameter block
--> pbVersion
Parameter block version number
--> usbCompletion
The completion routine
--> usbRefcon
General-purpose value passed back to the completion routine

<--> usbFlags
--> Direction of endpoint ( kUSBIn , kUSBOut , or kUSBAnyDirn )
<-- Direction is returned here if kUSBAnyDirn is used in the usbClassType field. Note that if kUSBAnyDirn is specified, this field is altered on the calls return. If you want to make another call to find an endpoint of any direction, kUSBAnyDirn must be specified again. Direction is also returned if kUSBIn or kUSBOut are specified. It will however, be the same value as that passed in.

<--> usbBuffer
--> Interface descriptor on the first call, points to an endpoint descriptor on subsequent calls
<-- Endpoint descriptor

<--> usbReqCount
Offset of interface or endpoint descriptor in configuration descriptor

<-- usbActcount
Length of endpoint descriptor found

<--> usbClassType
--> Specific endpoint type, or kUSBAnyType as wildcard
<-- Endpoint type

<--> usbOther
--> Endpoint number, always pass 0 unless you want to match a specific endpoint number.
<-- Next matching endpoint is returned

<-- usb.cntl.WValue
Maximum packet size of endpoint

The usbBuffer should be assigned the address of the start of the interface descriptor obtained from a call to the USBFindNextInterfaceDescriptorImmediate function. For each subsequent call to USBFindNextEndpointDescriptorImmediate , usbBuffer is assigned a pointer to the next endpoint descriptor within the specified interface.

The errors returned by the USBFindNextEndpointDescriptorImmediate function include:

kUSBNotFound
-6987 endpoint specified is not in configuration
kUSBInternalErr, paramErr
-6999 not a valid configuration descriptor

© 1999 Apple Computer, Inc.

Previous | Back Up One Level | Next | Show Frames | Hide Frames